<%@page import="com.ilibrary.web.vo.NewsVO"%>
<%@page import="java.util.List"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.ilibrary.constants.MyConstants"%>
<%@page import="com.ilibrary.web.vo.UserInfoVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="../_common.jsp" %>
<title>我大成信图书馆</title>
<link href="<%=request.getContextPath()%>/template_css/index/index.css" rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath()%>/template_css/index/index2.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=request.getContextPath()%>/template_js/index/public.js"></script>
</head>

<%
	UserInfoVO loginUser = (UserInfoVO)request.getSession().getAttribute(MyConstants.ILIBRARY_lOGIN_USER);
	HashMap<String, List<NewsVO>> newsListMap = (HashMap<String, List<NewsVO>>)request.getAttribute("newsListMap");
%>

<div id="all">
	<div class="warp">
		<div class="head_index">
			<span class="logo">
				<img src="<%=request.getContextPath() %>/template_images/index/logo_3.png">
			</span>
			<form id="clientLoginForm" action="<%=request.getContextPath() %>/doLogin.action" method="post">
			<span class="note">
				<p style="text-align: right;">
					<a href="javascript: void(0)" target="_blank">
						<img src="<%=request.getContextPath() %>/template_images/index/lg.gif" align="absmiddle">
					</a>
				</p>
				<%
				if(loginUser == null) {
				%>
				<p style="text-align: right;">
					<span id="loginm">
						学工号 <span id="usnm">
								<input name="userId" id="userId" onkeypress="huiche(event,6)" type="text">
							</span>
						密码 <span id="pswd">
								<input name="userPassword" id="userPassword" onkeypress="huiche(event,6)" type="password">
							</span>
							<input name="userType" value="<%=MyConstants.ILIBRARY_LOGIN_TYPE_STU%>" type="hidden">
							<span id="loginss" onclick="check_user()">&nbsp;</span>
					</span>
				</p>
				<%
				} else {
				%>
				<p style="text-align: right;">
					<span> 
						欢迎您： <span><a href="<%=request.getContextPath() %>/client/userCenter.action"><%=loginUser.getUserName() %></a>&nbsp;&nbsp;<a onclick="doLogout()" href="javascript: void(0)">退出</a></span> 
					</span>
				</p>
				<%
				}
				%>
			</span>
			</form>
		</div>
		<div class="flash_index">
			<div style="opacity: 1;" class="bannerImg banner0">
				<div class="triggers">
					<a class="trigger triggerSelect" href="javascript: void(0)" index="0" onkeypress="huiche(event,6)" onfocus="this.blur()">1</a> 
					<a class="trigger" href="javascript: void(0)" index="1" onfocus="this.blur()">1</a>
					<a class="trigger" href="javascript: void(0)" index="2" onfocus="this.blur()">1</a>
				</div>
				<!--切换按钮-->
				<div style="display: block;" class="banner">
					<a href="javascript: void(0)" target="_blank">
						<img alt="" src="<%=request.getContextPath() %>/template_images/index/20120412063938_23073.gif" border="0">
					</a>
				</div>
				<div style="display: none;" class="banner">
					<a href="javascript: void(0)" target="_blank">
						<img alt="" src="<%=request.getContextPath() %>/template_images/index/20120412063938_23073.gif" border="0">
					</a>
				</div>
				<div style="display: none;" class="banner">
					<a href="javascript: void(0)" target="_blank">
						<img alt="" src="<%=request.getContextPath() %>/template_images/index/20120412063938_23073.gif" border="0">
					</a>
				</div>
			</div>
		</div>
		<div class="line1_index">&nbsp;</div>
		<div class="center_index">
			<div class="left_index">
				<div class="c_l_1">
					<div id="nav" style="clear: left;">
						<li class="selected" id="search_1" onclick="change_tab_search(1)">
							<a onfocus="this.blur()" href="javascript:void(0);">纸本目录</a>
						</li>
						<li id="search_2" onclick="change_tab_search(2)">
							<a onfocus="this.blur()" href="javascript:void(0);">选库检索</a>
						</li>
						<li id="search_3" onclick="change_tab_search(3)">
							<a onfocus="this.blur()" href="javascript:void(0);">外文期刊</a>
						</li>
						<li id="search_4" onclick="change_tab_search(4)">
							<a onfocus="this.blur()" href="javascript:void(0);">随书光盘</a>
						</li>
						<li id="search_5" onclick="change_tab_search(5)">
							<a onfocus="this.blur()" href="javascript:void(0);">站内搜寻</a>
						</li>
					</div>
					<div class="search-box" id="search_box_1">
						<div class="search_content">
							<div class="searchbox">
								<div class="searchleft">
									<input class="searchright" style="text-align: center;"
										onfocus="this.blur()" onclick="search_zb()" type="button">
									<input id="catalog" value="" type="hidden">
									<!-- 存放下拉框的值-->
									<input id="keyword1" size="40"
										style="width: 294px; color: #666;"
										onkeypress="huiche(event,1)" class="text" value="请输入书名或作者等"
										onclick="if(this.value=='请输入书名或作者等'){this.value='';this.style.color='#666'}"
										onblur="if(this.value==''){this.value='请输入书名或作者等';}"
										type="text">
									<div class="searchsort_btn" onmouseout="allCategoryHide(4);"
										onmouseover="allCategoryShow(4);">
										<a href="javascript: void(0)"><span id="Show_Category_Name4">题&nbsp;&nbsp;名</span></a>
										<p id="search_all_category4">
											<a href="javascript:void(0)"
												onclick="selectCategory('title',4,this);"><span
												id="Show_Category_Name4">题&nbsp;&nbsp;名</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('author',4,this);"><span>责任者</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('keyword',4,this);"><span>主题词</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('isbn',4,this);"><span>ISBN/ISSN</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('asordno',4,this);"><span>订购号</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('callno',4,this);"><span>索书号</span>
											</a> <a href="javascript:void(0)"
												onclick="selectCategory('publisher',4,this);"><span>出版社</span>
											</a>
										</p>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="search-box" id="search_box_2" style="display: none">
						<div class="search_content">
							<div class="searchbox">
								<div class="searchleft">
									<input class="searchright" style="text-align: center;"
										onfocus="this.blur()" onclick="search_dzzy()" type="button">
									<input id="keyword2" size="40"
										style="width: 395px; color: #666;"
										onkeypress="huiche(event,2)" class="text" value="请输入题名或关键词"
										onclick="if(this.value=='请输入题名或关键词'){this.value='';this.style.color='#666'}"
										onblur="if(this.value==''){this.value='请输入题名或关键词';}"
										type="text">
								</div>
							</div>
						</div>
					</div>
					<div class="search-box" id="search_box_3" style="display: none">
						<div class="search_content">
							<div class="searchbox">
								<div class="searchleft">
									<input class="searchright" style="text-align: center;"
										onfocus="this.blur()" onclick="search_wwqk()" type="button">
									<input id="keyword3" size="40"
										style="width: 395px; color: #666;"
										onkeypress="huiche(event,3)" class="text"
										value="请输入期刊名称或期刊ISSN号"
										onclick="if(this.value=='请输入期刊名称或期刊ISSN号'){this.value='';this.style.color='#666'}"
										onblur="if(this.value==''){this.value='请输入期刊名称或期刊ISSN号';}"
										type="text">
								</div>
							</div>
						</div>
					</div>
					<div class="search-box" id="search_box_4" style="display: none">
						<div class="searchbox">
							<div class="searchleft">
								<input class="searchright" style="text-align: center;"
									onfocus="this.blur()" onclick="search_dmt()" type="button">
								<input id="keyword4" size="40"
									style="width: 395px; color: #666;" onkeypress="huiche(event,4)"
									class="text" value="请输入题名或关键词"
									onclick="if(this.value=='请输入题名或关键词'){this.value='';this.style.color='#666'}"
									onblur="if(this.value==''){this.value='请输入题名或关键词';}"
									type="text">
							</div>
						</div>
					</div>

					<div class="search-box" id="search_box_5" style="display: none">
						<div class="searchbox">
							<div class="searchleft">
								<input class="searchright" style="text-align: center;"
									onfocus="this.blur()" onclick="searchin()" type="button">
								<input id="keyword5" size="40"
									style="width: 395px; color: #666;" onkeypress="huiche(event,5)"
									class="text" value="请输入任意关键词"
									onclick="if(this.value=='请输入任意关键词'){this.value='';this.style.color='#666'}"
									onblur="if(this.value==''){this.value='请输入任意关键词';}" type="text">
							</div>
						</div>
					</div>
				</div>
				<div class="c_l_2"></div>
				<div class="c_l_3">
					<div class="c_div">
						<dl>
							<dt>
								<a href="javascript: void(0)"><img
									src="<%=request.getContextPath() %>/template_images/index/zydh.gif">
								</a>
							</dt>
							<dd>
								<ul style="width: 106px;">
									<li><a
										href="javascript: void(0)"
										target="_self">电子资源</a>
									</li>
									<li><a
										href="javascript: void(0)"
										target="_self">馆藏纸本目录</a>
									</li>
									<li><a
										href="javascript: void(0)"
										target="_self">外文期刊导航</a>
									</li>
									<li><a
										href="javascript: void(0)"
										target="_self">古籍目录</a>
									</li>
									<li><a
										href="javascript: void(0)"
										target="_self">开放获取资源</a>
									</li>
									<li><a
										href="javascript: void(0)"
										target="_self">外国教材中心</a>
									</li>
								</ul>
							</dd>
						</dl>
					</div>
					<div class="c_div">
						<dl>
							<dt>
								<a
									href="javascript: void(0)"><img
									src="<%=request.getContextPath() %>/template_images/index/dzfw.gif">
								</a>
							</dt>
							<dd>
								<ul style="width: 106px;">
									<%
										for(int i=0;i<6;i++) {
									%>
											<li><a href="javascript: void(0)" target="_blank">智慧图书馆服务</a></li>
									<%
										}
									%>
									</ul>
							</dd>
						</dl>
					</div>
					<div class="c_div c_div1" style="width: 50%; margin: 10px 0 0 4px;">
						<div class="c_ul2">
							<div>
								<a href="javascript: void(0)"><img
									src="<%=request.getContextPath() %>/template_images/index/friad_1.gif">
								<p>欢迎新同学</p>
								</a>
							</div>
							<div>
								<a
									href="javascript: void(0)"><img
									src="<%=request.getContextPath() %>/template_images/index/friad_2.gif">
								<p>读书节</p>
								</a>
							</div>
							<div>
								<a href="javascript: void(0)">
									<img src="<%=request.getContextPath() %>/template_images/index/lvse_030.gif">
									<p>咨询台</p>
								</a>
							</div>
							<div>
								<a href="javascript: void(0)">
									<img src="<%=request.getContextPath() %>/template_images/index/lvse_032.gif">
									<p>Mobile+</p>
								</a>
							</div>
						</div>
						<div class="c_ul">
							<div>
								<a href="javascript: void(0)">
									<img src="<%=request.getContextPath() %>/template_images/index/lvse_033.gif">
									<p>Pad+</p>
								</a>
							</div>
							<div>
								<a href="javascript: void(0)">
									<img src="<%=request.getContextPath() %>/template_images/index/lvse_031.gif">
									<p>Find+</p>
								</a>
							</div>
							<div>
								<a href="javascript: void(0)" target="_blank">
									<img src="<%=request.getContextPath() %>/template_images/index/friad_3.gif">
									<p>中文发现</p>
								</a>
							</div>
							<div>
								<a href="javascript: void(0)" target="_blank">
									<img src="<%=request.getContextPath() %>/template_images/index/friad_4.gif">
									<p>超星发现</p>
								</a>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="right_index">
				<div id="nav2">
					<li class="selected" id="search_56" onmouseover="change_tab_search2(56)">
						<a onfocus="this.blur()" href="javascript:void(0);">资源动态</a>
					</li>
					<li id="search_57" onmouseover="change_tab_search2(57)">
						<a onfocus="this.blur()" href="javascript:void(0);">服务动态</a>
					</li>
					<li id="search_58" onmouseover="change_tab_search2(58)">
						<a onfocus="this.blur()" href="javascript:void(0);">图书馆动态</a>
					</li>
				</div>
				<div style="display: block;" class="news" id="search_box_56">
					<ul>
					<%
						List<NewsVO> newsVOListZYDT = newsListMap.get("ZYDT");
						System.out.println("newsVOListZYDT+++++:"+newsVOListZYDT.size());
						NewsVO newsVOZYDT = null;
						for(int i=0;i<newsVOListZYDT.size();i++) {
					%>
						<li>
						<%
							newsVOZYDT = newsVOListZYDT.get(i);
							if(newsVOZYDT.getNewsTitle().length() > 15) {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOZYDT.getNewsId() %>" title="<%=newsVOZYDT.getNewsTitle() %>"><%=newsVOZYDT.getNewsTitle().substring(0,15)+"..."%></a>
						<%
							}else {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOZYDT.getNewsId() %>" title="<%=newsVOZYDT.getNewsTitle() %>"><%=newsVOZYDT.getNewsTitle() %></a>
						<%
							}
						%>
						</li>
					<%							
						}
					%>
					<li style="background: none; float: right; padding-right: 6px;">
						<a target="_blank" href="<%=request.getContextPath() %>/news/newsCenter.action">更多…</a>
					</li>
					</ul>
				</div>
				<div class="news" id="search_box_57" style="display: none">
					<ul>
					<%
						List<NewsVO> newsVOListFWDT = newsListMap.get("FWDT");
						System.out.println("newsVOListFWDT+++++:"+newsVOListFWDT.size());
						NewsVO newsVOFWDT = null;
						for(int i=0;i<newsVOListFWDT.size();i++) {
					%>
						<li>
						<%
							newsVOFWDT = newsVOListFWDT.get(i);
							if(newsVOFWDT.getNewsTitle().length() > 15) {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOFWDT.getNewsId() %>" title="<%=newsVOFWDT.getNewsTitle() %>"><%=newsVOFWDT.getNewsTitle().substring(0,15)+"..."%></a>
						<%
							}else {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOFWDT.getNewsId() %>" title="<%=newsVOFWDT.getNewsTitle() %>"><%=newsVOFWDT.getNewsTitle() %></a>
						<%
							}
						%>
						</li>
					<%							
						}
					%>
					<li style="background: none; float: right; padding-right: 6px;">
						<a target="_blank" href="<%=request.getContextPath() %>/news/newsCenter.action">更多…</a>
					</li>
					</ul>
				</div>
				<div class="news" id="search_box_58" style="display: none">
					<ul>
					<%
						List<NewsVO> newsVOListTSGDT = newsListMap.get("TSGDT");
						System.out.println("newsVOListTSGDT+++++:"+newsVOListTSGDT.size());
						NewsVO newsVOTSGDT = null;
						for(int i=0;i<newsVOListTSGDT.size();i++) {
					%>
						<li>
						<%
							newsVOTSGDT = newsVOListTSGDT.get(i);
							if(newsVOTSGDT.getNewsTitle().length() > 15) {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOTSGDT.getNewsId() %>" title="<%=newsVOTSGDT.getNewsTitle() %>"><%=newsVOTSGDT.getNewsTitle().substring(0,15)+"..."%></a>
						<%
							}else {
						%>
								<a target="_blank" href="<%=request.getContextPath() %>/news/newsView.action?newsId=<%=newsVOTSGDT.getNewsId() %>" title="<%=newsVOTSGDT.getNewsTitle() %>"><%=newsVOTSGDT.getNewsTitle() %></a>
						<%
							}
						%>
						</li>
					<%							
						}
					%>
					<li style="background: none; float: right; padding-right: 6px;">
						<a target="_blank" href="<%=request.getContextPath() %>/news/newsCenter.action">更多…</a>
					</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="foot_center">
			<span class="frist"><a href="http://www.cuit.edu.cn" target="_blank">我大成信</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">四川省高校图工委</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">JALIS管理中心</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">CALIS管理中心</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">CADAL管理中心</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">四川工程文献中心</a></span>
			<span><a href="http://www.cuit.edu.cn" target="_blank">怀念老主页</a></span>
		</div>
		<div class="foot_index">
			<p>航空港校区：成都市双流县西南航空港经济开发区 学府路一段24号 邮编：610225</p>
			<p>
				Copyright 2013 Chengdu University Of Information Technology Library. All Right Reserved 
				<a href="javascript: void(0)" target="_blank"><img src="<%=request.getContextPath() %>/template_images/index/pic.gif" border="0" hspace="0">
				</a>
			</p>
			<p>&nbsp;</p>
		</div>
	</div>
</div>
<script language="javascript" type="text/javascript">
	/******搜索下拉js****/
	function allCategoryShow(tag) {
		document.getElementById('search_all_category' + tag).style.display = "block";
	}
	function allCategoryHide(tag) {
		document.getElementById('search_all_category' + tag).style.display = "none";
	}
	function selectCategory(val, tag, obj) {
		document.getElementById('catalog').value = val;
		document.getElementById('search_all_category' + tag).style.display = "none";
		var text = obj.childNodes[0].innerHTML;
		document.getElementById('Show_Category_Name' + tag).innerHTML = text;

	}

	/******搜索下拉js****/

	function show_log_portal(msg) {
	}
	$('.banner').html(sys_pub[0]['Image']);
	var tmps_keyword = '';
	function change_tab_search(num) {
		if (tmps_keyword != '') {
			$('#keyword' + num).val(tmps_keyword);
		}
		//<li id=search_2 onclick='change_tab_search(2)'><a href="javascript:void(0);"><em>电子资源</em></a></li>
		$('#search_1').removeClass('selected');
		$('#search_2').removeClass('selected');
		$('#search_3').removeClass('selected');
		$('#search_4').removeClass('selected');
		$('#search_5').removeClass('selected');

		//<div class="search-box" id='search_box_1'>
		$('#search_box_1').hide();
		$('#search_box_2').hide();
		$('#search_box_3').hide();
		$('#search_box_4').hide();
		$('#search_box_5').hide();

		$('#search_' + num).addClass('selected');
		$('#search_box_' + num).show();
	}
	function change_tab_search2(num) {
		$('#search_56').removeClass('selected');
		$('#search_57').removeClass('selected');
		$('#search_58').removeClass('selected');

		$('#search_box_56').hide();
		$('#search_box_57').hide();
		$('#search_box_58').hide();

		$('#search_' + num).addClass('selected');
		$('#search_box_' + num).show();
	}
	/*******************处理回车**********************************/
	function get_login_message(event, type) {
		if (event.keyCode == 13) {
			if (type == 1) {
				check_login_message();
			} //登录
			else if (type == 2) {
				get_search_book_url();
			} //找回密码
			else if (type == 3) {
				get_ad_searchbook();
			} //用户注册
			else if (type == 4) {
				get_search_url();
			} //修改密码
			else if (type == 5) {
				get_ad_search_url();
			} //修改密码dz_news
			else if (type == 6) {
				dz_news();
			}
		}

	}
	function huiche(event, type) {
		if (event.keyCode == 13) {
			switch (type) {
			case 1:
				search_zb();
				break;
			case 2:
				search_dzzy();
				break;
			case 3:
				search_wwqk();
				break;
			case 4:
				search_dmt();
				break;
			case 5:
				searchin();
				break;
			case 6:
				check_user();
				break;
			}
		}
	}
	$(function() {
		var selectIndex = 0;
		var isLock = false;
		var timeout;
		var time = 8000;
		$(".banner").eq(selectIndex).show();
		$(".trigger").click(function() {
			var index = $(this).attr("index");
			if (index == selectIndex || isLock) {
				return;
			}
			stopAutoTrigger();
			selectTrigger(index);
		});
		var selectTrigger = function(index) {
			isLock = true;
			$(".trigger").removeClass("triggerSelect");
			$(".bannerImg").fadeTo("normal", 0.3, function() {
				$(".bannerImg").removeClass("banner" + selectIndex);
				$(".bannerImg").addClass("banner" + index);
				$(".banner").eq(selectIndex).hide();
				$(".banner").eq(index).show();
				$(".bannerImg").fadeTo("normal", 1, function() {
					selectIndex = index;
					isLock = false;
				});
			});
			$(".trigger").eq(index).addClass("triggerSelect");
			startAutoTrigger();
		};

		timeout = setTimeout(function() {
			var index = (selectIndex + 1) % 3;
			selectTrigger(index);
		}, time);
		window.startAutoTrigger = function() {
			timeout = setTimeout(function() {
				var index = (selectIndex + 1) % 3;
				selectTrigger(index);
			}, time);
		}
		window.stopAutoTrigger = function() {
			clearTimeout(timeout);
		};
	});
</script>

<script type="text/javascript">

	function check_user() {
		var userId = $('#userId').val();
		var userPassword = $('#userPassword').val();
		if(userId == null || userId == '') {
			alert("请输入有效登录学号！");
			$('userId').focus();
			return false;
		}
		if(userPassword == null || userPassword == '') {
			alert("请输入有效登录密码！");
			$('userPassword').focus();
			return false;
		}
		$('#clientLoginForm').submit();
	}
	
	function search_zb() {
		var keywords = $('#keyword1').val();
		if(keywords == null || keywords == '') {
			alert("请输入查询关键字");
		}else {
			doSearchBooks(keywords);
		}
	}
	
	function search_dzzy() {
		var keywords = $('#keyword2').val();
		if(keywords == null || keywords == '') {
			alert("请输入查询关键字");
		}else {
			doSearchBooks(keywords);
		}
	}
	
	function search_wwqk() {
		var keywords = $('#keyword3').val();
		if(keywords == null || keywords == '') {
			alert("请输入查询关键字");
		}else {
			doSearchBooks(keywords);
		}
	}
	
	function search_dmt() {
		var keywords = $('#keyword4').val();
		if(keywords == null || keywords == '') {
			alert("请输入查询关键字");
		}else {
			doSearchBooks(keywords);
		}
	}
	
	function searchin() {
		var keywords = $('#keyword5').val();
		if(keywords == null || keywords == '') {
			alert("请输入查询关键字");
		}else {
			doSearchBooks(keywords);
		}
	}
	
	function doSearchBooks(keywords) {
		if(keywords == "请输入书名或作者等") {
			keywords = "";
		}
		window.open("<%=request.getContextPath() %>/book/doSearchBooks.action?keywords="+keywords+"&currentPage=1");
	}
</script>

</html>